@extends('home.frame')

@section('content')
    <link href="/ho/css/addstyle.css" rel="stylesheet" type="text/css">
    <script src="/ho/area.js"></script>
    <div class="am-u-md-12 am-u-lg-8" style="margin-top: 20px;">
        <form class="am-form am-form-horizontal" method="post" action="/home/address/update/{{$data[0]['bid']}}">
            {{ csrf_field() }}
            <input type="hidden"  placeholder="用户" name="buid" value="{{$data[0]['b_uid']}}">
            <div class="am-form-group">
                <label for="user-name" class="am-form-label">收货人</label>
                <div class="am-form-content">
                    <input type="text" id="user-name" placeholder="收货人" name="bconsignee" value="{{$data[0]['bconsignee']}}">
                </div>
            </div>

            <div class="am-form-group">
                <label for="user-phone" class="am-form-label">手机号码</label>
                <div class="am-form-content">
                    <input id="user-phone" placeholder="手机号必填" type="text" name="bphone" value="{{$data[0]['bphone']}}">
                </div>
            </div>
            <div class="am-form-group">
                <label for="user-phone" class="am-form-label">邮编</label>
                <div class="am-form-content">
                    <input id="user-phone" placeholder="邮编必填" type="text" name="bpostalcode" value="{{$data[0]['bpostalcode']}}">
                </div>
            </div>
            <div class="am-form-group">
                <label for="user-address" class="am-form-label">所在地</label>
                <div class="am-form-content address">
                    {{--<select data-am-selected>--}}
                    {{--<option value="a">浙江省</option>--}}
                    {{--<option value="b" selected>湖北省</option>--}}
                    {{--</select>--}}
                    {{--<select data-am-selected>--}}
                    {{--<option value="a">温州市</option>--}}
                    {{--<option value="b" selected>武汉市</option>--}}
                    {{--</select>--}}
                    {{--<select data-am-selected>--}}
                    {{--<option value="a">瑞安区</option>--}}
                    {{--<option value="b" selected>洪山区</option>--}}
                    {{--</select>--}}
                    <select data-am-selected id="Province" runat="server" name="province" style="width: 90px" ></select>
                    <select data-am-selected id="Country" runat="server" name="country" style="width: 90px"></select>
                    <select data-am-selected id="Town" runat="server" name="town" style="width: 90px"></select>
                    <?php
                        $province = $data['province'];
                        echo "<script>var province = \"$province\"</script>";
                        $country= $data['country'];
                        echo "<script>var country = \"$country\"</script>";
                        $town = $data['town'];
                        echo "<script>var town = \"$town\"</script>";
                    ?>
                    <script language="javascript">
                 //  console.log($("#Province > select"));
                      // $('#Province ').val("pxx");


                 setup();
                 $("#Province").find("option[value = "+province+"]").attr("selected",true);
                 $("#Country").find("option[value = "+country+"]").attr("selected",true);
                 $("#Town").find("option[value = "+town+"]").attr("selected",true);



                    </script>
                </div>
            </div>

            <div class="am-form-group">
                <label for="user-intro" class="am-form-label">详细地址</label>
                <div class="am-form-content">
                    <textarea class="" rows="3" id="user-intro" placeholder="输入详细地址" name="baddress">{{$data['baddress']}}</textarea>
                    <small>100字以内写出你的详细地址...</small>
                </div>
            </div>

            <div class="am-form-group">
                <div class="am-u-sm-9 am-u-sm-push-3">
                    {{--<a class="am-btn am-btn-danger">保存</a>--}}
                    <button type="submit">保存</button>
                    <a href="/ho/javascript: void(0)" class="am-close am-btn am-btn-danger" data-am-modal-close>取消</a>
                </div>
            </div>
        </form>
    </div>
    @endsection

